<!-- 功能  磁盘检测 - 磁盘检测操作弹窗 | 作者：menghao.yan | 邮箱：yxs2615@163.com | 时间：2023年08月24日 14:23:00 -->
<template>
  <!-- 弹出框 -->
  <a-modal v-model:open="visible" title="磁盘检测操作" width="700px" class="y-modal" okText="创建" @ok="onSubmit" @cancel="onCancel">
    <a-card>
      <a-descriptions layout="vertical" bordered size="small" :column="5">
        <a-descriptions-item label="设备">xx</a-descriptions-item>
        <a-descriptions-item label="型号">龙芯3A3000</a-descriptions-item>
        <a-descriptions-item label="设备序列号">ahdahjljdasljdlas</a-descriptions-item>
        <a-descriptions-item label="检测状态">未检测</a-descriptions-item>
      </a-descriptions>

      <a-form :label-col="{ span:4 }" :wrapper-col="{span: 14}" class="y-cipanjiance-form">
        <a-form-item label="检测方式">
          <a-radio-group v-model:value="type">
            <a-radio value="kuaiSuJianCe">快速检测</a-radio>
            <a-radio value="quanMianJianCe">全面检查</a-radio>
          </a-radio-group>
        </a-form-item>
      </a-form>
      <a-row>
        <a-col :offset="4">
          <a-space>
            <a-button type="link" class="y-btn" @click="">开始</a-button>
            <a-button type="link" class="y-btn" @click="">停止</a-button>
            <a-button type="link" class="y-btn" @click="">查看结果</a-button>
            <a-button type="link" class="y-btn" @click="">查看异常</a-button>
            <a-button type="link" class="y-btn" @click="">刷新</a-button>
          </a-space>
        </a-col>
      </a-row>
    </a-card>
  </a-modal>
</template>

<script setup>
const props = defineProps({
  visible: {
    type: Boolean,
    default: false
  }
})

const { visible } = toRefs(props)

// 定义组件的事件
const emits = defineEmits(['update:visible'])

const type = ref('kuaiSuJianCe')

const onSubmit = () => {
  console.log('磁盘检测操作>>')
  onCancel()
}

const onCancel = () => {
  // 触发自定义事件来通知父组件关闭弹窗
  emits('update:visible', false)
}
</script>

<style scoped>
.ant-row {
  margin-bottom: 10px;
}
.y-close-jieneng {
  color: red;
}
::v-deep.ant-descriptions.ant-descriptions-bordered .ant-descriptions-item-label {
  background: #dfeffc url('../../assets/images/menu-btn-bg.png') 50% 50% repeat-x;
  font-weight: bold;
  color: #2e6e9e;
  margin-bottom: 4px;
}
.y-cipanjiance-form {
  margin-top: 2rem;
}
</style>